package com.yiwangqingshui;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Enumeration;
import java.util.Properties;

/**
 * @author <a href="mailto:sunmch@163.com">smc</a>
 * @date 2019-07-11 20:19
 * @since
 **/
public class MetaInfoMain {

    private static final String META_INF_PATH = "META-INF/spring.factories";

    public static void main(String[] args) {

        try {
            Enumeration<URL> enumeration = Thread.currentThread().getContextClassLoader().getResources(META_INF_PATH);
            while (enumeration.hasMoreElements()) {
                URL url = enumeration.nextElement();
                System.out.println("url: " + url);
                InputStream inputStream = url.openStream();
                System.out.println(inputStream);
//                Properties properties = new Properties();
//                properties.load(inputStream);
//                properties.entrySet().forEach(key -> {
//                    System.out.println("val: " + key.getValue());
//                });
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
